package ch0300;

public class AbstractArray {

	public static void main(String[] args) {
		// TODO 自动生成的方法存根
		float mainJi=0;
		Shape[] s= {new Circle(3),new Circle(4),new Circle(5),new Square(1, 2),
				new Square(3, 4),new Triangle(6, 7)};
		for (int i = 0; i < s.length; i++) {
			mainJi +=s[i].area();
		}
		System.out.println("图形的总面积为："+mainJi);
	}

}
